Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: execMintStatemine and execMintStatemine #6928

Merged
merged 4 commits into from
Aug 26, 2023

Conversation

floyd-li
Copy link
Member

@floyd-li floyd-li commented Aug 24, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

to resolve this one:
图片

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Did your issue had any of the "$" label on it?

  • Fill up your DOT address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

Copilot Summary

🤖 Generated by Copilot at cd51297

Refactored the minting logic for Basilisk and Statemine tokens by using a common transactionFactory function. This reduced code duplication and improved readability. Added the transactionFactory function to ./composables/transaction/mintToken/utils.ts.

🤖 Generated by Copilot at cd51297

We're minting tokens on the chain, me hearties
We're using transactionFactory to make it easy
We've refactored the code and removed the clutter
So pull on the rope and sing with me, one, two, three!

@floyd-li floyd-li requested a review from a team as a code owner August 24, 2023 10:32
@floyd-li floyd-li requested review from stephenjason89 and roiLeo and removed request for a team August 24, 2023 10:32
@netlify
Copy link

netlify bot commented Aug 24, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 28d7f4b
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64e8b61f06a89c000862d5b5
😎 Deploy Preview https://deploy-preview-6928--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 24, 2023

AI-Generated Summary: This pull request primarily refactors the execMintBasilisk and execMintStatemine functions in the transactionMintBasilisk.ts and transactionMintStatemine.ts files respectively. The majority of the code in these functions has been moved to a new function transactionFactory in utils.ts, which has simplified their structures and reduced code duplication. This newly created function generates a transaction based on the provided arguments. Furthermore, in type import statements, unnecessary types like MintTokenParams and ActionMintToken have been removed for better clarity. With these modifications, code readability and maintainability have been improved.

status.value = 'loader.ipfs'
const args = await getArgs(item, api)

const nameInNotifications = Array.isArray(item.token)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

@@ -22,3 +22,38 @@ export const calculateFees = () => {

return { enabledFees, feeMultiplier }
}

export const transactionFactory = (getArgs) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function transactionFactory has 29 lines of code (exceeds 25 allowed). Consider refactoring.

@reviewpad reviewpad bot added medium Pull request is medium waiting-for-review labels Aug 24, 2023
@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 24, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

@yangwao
Copy link
Member

yangwao commented Aug 24, 2023

Code Climate has analyzed commit cd51297 and detected 3 issues on this pull request.

Solving 2 code climate issues, code climate raises 3 more issues 😄

@floyd-li
Copy link
Member Author

Code Climate has analyzed commit cd51297 and detected 3 issues on this pull request.

Solving 2 code climate issues, code climate raises 3 more issues 😄

hmm resolved

Copy link
Contributor

@stephenjason89 stephenjason89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm 😊

@codeclimate
Copy link

codeclimate bot commented Aug 25, 2023

Code Climate has analyzed commit 28d7f4b and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yangwao
Copy link
Member

yangwao commented Aug 26, 2023

great!
pay 50 usd

@yangwao yangwao merged commit c5c6bcd into kodadot:main Aug 26, 2023
15 checks passed
@yangwao
Copy link
Member

yangwao commented Aug 26, 2023

😍 Perfect, I’ve sent the payout
💵 $50 @ 4.5 USD/DOT ~ 11.111 $DOT
🧗 13rv1SWoLg9Gb3tmvHPZxb7JbVy51BtMziX7k9WQGSJ7Kp3A
🔗 0x5180a160fcd07fcf1962c9a7f70880e43df7d9d9e38239968f3980bd566edc38

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Aug 26, 2023
@Jarsen136
Copy link
Contributor

image

@floyd-li Hey, there is something broken here.

@floyd-li
Copy link
Member Author

image

@floyd-li Hey, there is something broken here.

sry my bad there's a constant naming issue. gonna make a quick pr for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Pull request is medium paid pull-request has been paid waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants